Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
An unhandled reporting failure can abort package processing, skip ZIP cleanup, and prevent manifest writeback and application launch even when patching succeeds.
4 open issues
What changed in this PR
Adds opt-in durable reporting to the update workflow, with disk-backed storage and host-driven replay across processes sharing a queue.
Changes:
- Adds FIFO report persistence and replay with explicit at-least-once delivery semantics.
- Requires HTTP and business-level success before acknowledging delivery, while retaining best-effort default reporting.
- Adds configured reporter registration, focused tests, and operational documentation.
| File | Description |
|---|---|
| tests/CoreTest/Download/PersistentUpdateReporterTests.cs | Covers rejection, recovery, duplicates, concurrency, corruption, cancellation, and registration. |
| src/GeneralUpdate.Core/Download/Reporting/PersistentUpdateReporter.cs | Implements disk-backed queuing, locking, and ordered replay. |
| src/GeneralUpdate.Core/Download/Reporting/IUpdateReporter.cs | Adds strict delivery confirmation and response disposal. |
| src/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs | Supports configured reporter instances and replacement registration. |
| README.md | Documents setup, replay responsibilities, and delivery limitations. |
Review effort: Balanced
| { | ||
| if (File.Exists(temp)) File.Delete(temp); | ||
| } | ||
| await ReplayLockedAsync(token).ConfigureAwait(false); |
| public TBootstrap UpdateReporter(Download.Reporting.IUpdateReporter reporter) | ||
| { | ||
| if (reporter == null) throw new ArgumentNullException(nameof(reporter)); | ||
| _instances[typeof(Download.Reporting.IUpdateReporter)] = reporter; |
Comment on lines
+65
to
+66
| using (await AcquireLockAsync(token).ConfigureAwait(false)) | ||
| await ReplayLockedAsync(token).ConfigureAwait(false); |
Comment on lines
+62
to
+67
| var handler = new Handler(_ => throw new HttpRequestException("offline")); | ||
| var tasks = Enumerable.Range(1, 8).Select(async i => | ||
| { | ||
| await Assert.ThrowsAsync<HttpRequestException>(() => Create(handler).ReportAsync(new UpdateReport(i, 3))); | ||
| }); | ||
| await Task.WhenAll(tasks); |
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
code: 200/body: truebefore acknowledging reports; preserve best-effort behavior for the default reporter.Delivery semantics
At-least-once, not exactly-once: a lost response or crash after acceptance can result in repeated failure counts. Server-side event IDs and deduplication are required for exactly-once effects. Ordering covers only reporters sharing the queue; the host must register the reporter in every reporting process and schedule replay. Reports are recoverable after their flushed queue file has been published, subject to filesystem durability.
Verification